package com.caishi.lkx.exam.question;

import cn.hutool.core.util.ObjectUtil;
import com.caishi.lkx.exam.model.QuestionModel;


/**
 * 主观题
 */
public abstract class SubjectiveQuestionDataProcess<AS extends Object> extends AbstractQuestionDataProcess implements Question<AS> {

    public double computedQualityLevel(QuestionModel questionModel) {
        double baseScore = super.computedQualityLevel(questionModel);
        // 主观题(5分)
        return baseScore + computedRightAnswerQualityLevel(questionModel) * 0.5;
    }

    @Override
    public boolean userAnswerIsRight(AS rightAnswer, AS userAnswer) {
        return !ObjectUtil.isEmpty(userAnswer);
    }
}
